using System;
using System.Collections.Generic;
using System.Text;
using MaskData;

namespace DBProxy
{
	public class AccessQueryService
	{
		public static MaskNodes QueryByNode(NavigateTreeNode navigateNode)
		{
			IQueryMask query = Factory.Instance().CreateQueryMask();
            ITypesReader reader = Factory.Instance().CreateReader();
			MaskNodes nodes = query.QueryByNavigateNode(reader, navigateNode);
			return nodes;
		}
		public static MaskNodes QueryChildNodes(MaskNode node, String maskNodeId)
		{
            IQueryMask query = Factory.Instance().CreateQueryMask();
            ITypesReader reader = Factory.Instance().CreateReader();
			MaskNodes nodes = query.GetChildNodes(reader, node, maskNodeId);
			return nodes;
		}
		public static void SaveMaskNode(MaskNode node, String maskNodeId, String keyField, String keyValue)
		{
            IMaskNodeWriter writer = Factory.Instance().CreateWriter();
			writer.SaveMaskNode(node, maskNodeId, keyField, keyValue);
		}
	}
}
